<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="fed" uri="WEB-INF/customTag.tld"%>
<%@ include file="/WEB-INF/jspf/jsDefault.jspf" %>
<f:view>
    <html>
        <head>
            <%@ include file="/WEB-INF/jspf/header.jspf" %>
        </head>
        <body>
            <%@ include file="/WEB-INF/jspf/controlloAmministratore.jspf" %>
            <div id="main">
                <header>
                    <div id="logo">
                        <%@ include file="/WEB-INF/jspf/logoContent.jspf" %>
                    </div>
                    <nav id="barraMenu">
                        <div id="menu_container">
                            <ul class="sf-menu" id="nav">
                                <h:form>
                                    <%@ include file="/WEB-INF/jspf/menu/admin.jspf" %>
                                </h:form>
                            </ul>
                        </div>
                    </nav>
                </header>
                <div id="site_content">
                    <div id="sidebar_container">
                        <%@ include file="/WEB-INF/jspf/loggedForm.jspf" %>
                    </div>
                    <div class="content">
                        <h6><h:outputText value="#{SedeBean.message}"/></h6>
                        <div id="accordion">
                            <h3>
                                Aggiungi Sede
                            </h3>
                            <div>
                                <h:form>
                                    <table>
                                        <tr>
                                            <td>Provincia:</td>
                                            <td>
                                                <h:selectOneMenu id="provincia" value="#{SedeBean.provincia}">
                                                    <f:selectItems value="#{BeanProvince.listaProvince}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Città:</td>
                                            <td>
                                                <h:inputText id="citta" value="#{SedeBean.citta}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Via:</td>
                                            <td>
                                                <h:inputText id="via" value="#{SedeBean.via}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Cap:</td>
                                            <td>
                                                <h:inputText id="cap" value="#{SedeBean.cap}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Telefono:</td>
                                            <td>
                                                <h:inputText id="telefono" value="#{SedeBean.telefono}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>email:</td>
                                            <td>
                                                <h:inputText id="email" value="#{SedeBean.email}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Responsabile di riferimento:</td>
                                            <td>
                                                <h:selectOneMenu id="sede" value="#{SedeBean.responsabile}" >
                                                    <f:selectItems value="#{SedeBean.listaResponsabili}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td><h:commandButton id="crea" value="Crea" action="#{SedeBean.crea}" styleClass="ui-button ui-widget ui-state-default"/></td>
                                        </tr>
                                    </h:form>
                                </table>
                            </div>

                            <h3>
                                Modifica Sede
                            </h3>
                            <div>
                                <table>
                                    <h:form>
                                        <tr>
                                            <td>Sede da modificare:</td>
                                            <td>
                                                <h:selectOneMenu id="sede2" value="#{SedeBean.idSede}" onchange="submit()">
                                                    <f:selectItems value="#{SedeBean.listaSedi}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Provincia:</td>
                                            <td>
                                                <h:selectOneMenu id="provincia2" value="#{SedeBean.provinciaModifica}" >
                                                    <f:selectItems value="#{BeanProvince.listaProvince}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Città:</td>
                                            <td>
                                                <h:inputText id="citta2" value="#{SedeBean.cittaModifica}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Via:</td>
                                            <td>
                                                <h:inputText id="via2" value="#{SedeBean.viaModifica}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Cap:</td>
                                            <td>
                                                <h:inputText id="cap2" value="#{SedeBean.capModifica}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Telefono:</td>
                                            <td>
                                                <h:inputText id="telefono2" value="#{SedeBean.telefonoModifica}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>email:</td>
                                            <td>
                                                <h:inputText id="email2" value="#{SedeBean.emailModifica}">
                                                </h:inputText>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Responsabile di riferimento:</td>
                                            <td>
                                                <h:selectOneMenu id="responsabile" value="#{SedeBean.responsabileModifica}" >
                                                    <f:selectItems value="#{SedeBean.listaResponsabili}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr><td></td>
                                            <td><h:commandButton id="modifica" value="Modifica" action="#{SedeBean.modifica}" styleClass="ui-button ui-widget ui-state-default" onclick="if (!confirm('Sicuro di voler modificare?')) return false;"/></td>
                                        </tr>
                                    </h:form>
                                </table>
                            </div>
                            <h3>
                                Elimina Sede
                            </h3>
                            <div>
                                <table>
                                    <h:form>
                                        <tr>
                                            <td>Sede:</td>
                                            <td>
                                                <h:selectOneMenu id="sede3" value="#{SedeBean.idSedeElimina}" >
                                                    <f:selectItems value="#{SedeBean.listaSedi}" />
                                                </h:selectOneMenu>
                                            </td>
                                        </tr>
                                        <tr><td></td>
                                            <td><h:commandButton onclick="if (!confirm('Sicuro di voler eliminare?')) return false;" id="elimina" value="Elimina" action="#{SedeBean.elimina}" styleClass="ui-button ui-widget ui-state-default"/></td>
                                        </tr>
                                    </h:form>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <footer>
                    <p>Copyright &copy; FF-RL 2014</p>
                </footer>
            </div>
            <p>&nbsp;</p>
            <%@ include file="/WEB-INF/jspf/animazioneAccordion.jspf" %>
            <%@ include file="/WEB-INF/jspf/menu/scriptAnimazioneMenu.jspf" %>
            <%@ include file="/WEB-INF/jspf/about/contatti.jspf" %>
        </body>
    </html>
</f:view>